﻿var browse="";
var nodelist;
var xmlDoc;
var xml;
var url="";
var nodevalue;

function LoadXml(){
	
	if (window.ActiveXObject)
    	{       
        	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        	xmlhttp.open("GET", url, false);
        	xmlhttp.send(null);
		xml = new ActiveXObject("Microsoft.XMLDOM");			
		xml.loadXML(xmlhttp.responseText);		       
        	browse="ie";
    	}
    	else if (document.implementation && document.implementation.createDocument)
    	{
        	xml=document.implementation.createDocument('', '', null); 
        	xml.async = false;   //同步载入             
        	xml.load(url);
        	browse="ff";
    	}	
	
}


function LoadXml_new(){
	
	if (window.ActiveXObject)
    	{       
        	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        	xmlhttp.open("GET", url, false);
        	xmlhttp.send(null);
		xml = new ActiveXObject("Microsoft.XMLDOM");			
		xml.loadXML(xmlhttp.responseText);		       
        	browse="ie";
        	nodelist = xml.selectNodes("//record");
        	
    	}
    	else if (document.implementation && document.implementation.createDocument)
    	{
        	xml=document.implementation.createDocument('', '', null); 
        	xml.async = false;   //同步载入             
        	xml.load(url);
        	browse="ff";
        	nodelist = xml.getElementsByTagName("record");
        	
    	}	
	
}


function getNodeValue(i,nodename) {
       
	if (navigator.appName.indexOf("Explorer")>0) { 
	
		 if (nodelist.item(i).selectSingleNode(nodename).text != "null") 
	         nodevalue=nodelist.item(i).selectSingleNode(nodename).text;
	         
	}
	else {	
	 if (xml.getElementsByTagName(nodename)[i].childNodes[0].nodevalue !="null") 
            	nodevalue=xml.getElementsByTagName(nodename)[i].childNodes[0].nodeValue;	
	}
	return nodevalue;
	
}